<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:body>

	<ui:composition template="../template/template.xhtml">

		<ui:define name="content">
			<h:form id = "registerForm">
				<p:growl id="growl" />
				<p:panel id="registerPanel" header="register">
					<table id="registerTable">
						<tr>
							<td><h:outputLabel for="registerAsProvider"
									value="register as*" /></td>
							<td><p:selectOneRadio id="registerAsProvider"
									value="#{registerJSF.registerAsProvider}">
									<f:selectItem itemLabel="client" itemValue="#{false}" />
									<f:selectItem itemLabel="provider" itemValue="#{true}" />
								</p:selectOneRadio></td>
						</tr>
						<tr>
							<td><h:outputLabel for="email" value="email*" /></td>
							<td><p:inputText id="email"
									value="#{registerJSF.personalData.email}" required="true"
									label="email" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="password" value="password*" /></td>
							<td><p:password id="password"
									value="#{registerJSF.personalData.password}" feedback="true"
									match="confirmPassword" label="password" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="confirmPassword"
									value="confirm password*" /></td>
							<td><p:password id="confirmPassword"
									value="#{registerJSF.confirmPassword}"
									label="confirmPassword" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="firstName" value="first name*" /></td>
							<td><p:inputText id="firstName"
									value="#{registerJSF.personalData.forename}" required="true"
									label="firstName" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="lastName" value="last name*" /></td>
							<td><p:inputText id="lastName"
									value="#{registerJSF.personalData.surname}" required="true"
									label="lastName" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="phoneNumber" value="phone*" /></td>
							<td><p:inputText id="phoneNumber"
									value="#{registerJSF.personalData.phone_number}"
									required="true" label="phoneNumber" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="country" value="country*" /></td>
							<td><p:inputText id="country"
									value="#{registerJSF.location.country}"
									required="true" label="country" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="city" value="city*" /></td>
							<td><p:inputText id="city"
									value="#{registerJSF.location.city}"
									required="true" label="city" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="zip" value="zip*" /></td>
							<td><p:inputText id="zip"
									value="#{registerJSF.location.zip}"
									required="true" label="zip" /></td>
						</tr>
						<tr>
							<td><h:outputLabel for="street" value="street*" /></td>
							<td><p:inputText id="street"
									value="#{registerJSF.location.street}"
									required="true" label="street" /></td>
						</tr>
					</table>
					<p:commandButton value="register" styleClass="bottomButton" id="register"
						action="#{registerJSF.performRegister}" update="growl"/>
				</p:panel>
			</h:form>
		</ui:define>

	</ui:composition>

</h:body>

</html>